﻿using System;
using System.Drawing;
using System.Xml.Serialization;

namespace MobileCarManager.MobileControls.Styles
{
  /// <summary>Implements the style of a border.</summary>
  [Serializable]
  public class BorderStyle
  {
    /// <summary>Constructor.</summary>
    public BorderStyle()
    {
      Width = 1;
      Color = Color.Black;
    }

    /// <summary>Returns the width of the border.</summary>
    [XmlElement("Width")]
    public int Width { get; set; }

    /// <summary>Returns the color of the border.</summary>
    [XmlIgnore]
    public Color Color { get; set; }

    /// <summary>Returns the color of the border in a serializable form. This property is used for
    /// serialization.
    /// </summary>
    [XmlElement("Color")]
    public string SerializableColor
    {
      get { return StyleManager.SerializeColor(this.Color); }
      set { this.Color = StyleManager.DeserializeColor(value); }
    }
  }
}
